package com.cmxh.shipper;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;

@SpringBootApplication
@MapperScan("com.cmxh.shipper.mapper")
public class ShipperApplication {

    public static void main(String[] args) {
        SpringApplication.run(ShipperApplication.class, args);

    }
//    @Bean
//    public RedisTemplate<String,Object> xx(RedisConnectionFactory df) {
//        RedisTemplate<String, Object> qq = new RedisTemplate<>();
//        qq.setConnectionFactory(df);// 设置redis的连接工厂
//        // 设置key的序列化方式 string的序列化方式
//        qq.setKeySerializer(new StringRedisSerializer());
//        // 设置value的序列化方式  json
//        Jackson2JsonRedisSerializer<Object> qw =
//                new Jackson2JsonRedisSerializer<Object>(Object.class);
//        qq.setValueSerializer(qw);
//
//        return qq;
//
//    }


}
